package com.chen.qmzy.service;

import com.chen.qmzy.dao.DwIpDao;
import com.chen.qmzy.entity.ResultEntity;
import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class DwIndexService {
    private static final Logger logger= LoggerFactory.getLogger(DwIndexService.class);//日志getLogger需要传入的类名
    @Resource
    DwIpDao dwIpDao;

    /**
     * 查询动物列表
     * @return String
     */
    public String getProductList(){
        try{
            return ResultEntity.success(dwIpDao.getProductList());
        }catch (Exception e){
            logger.error(e.getLocalizedMessage());
            return ResultEntity.fail(-10005);
        }
    }

    /**
     * 轮播图片
     * @return String
     */
    public String getCarouselList(){
        try{
            return ResultEntity.success(dwIpDao.getCarouselList());
        }catch (Exception e){
            logger.error(e.getLocalizedMessage());
            return ResultEntity.fail(-10005);
        }
    }


}
